home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 014a / vgakit34.zip / EXAMPLE.C < prev    next >
Text File  |  1990-05-04  |  1KB  |  84 lines

  1. /*
  2.     VGAKIT Version 3.4
  3.  
  4.     Copyright 1988,89,90 John Bridges
  5.     Free for use in commercial, shareware or freeware applications
  6.  
  7.     EXAMPLE.C
  8. */
  9.  
  10. extern int tseng;
  11. extern int tseng4;
  12. extern int trident;
  13. extern int video7;
  14. extern int paradise;
  15. extern int chipstech;
  16. extern int ativga;
  17. extern int everex;
  18. extern int aheada;
  19. extern int aheadb;
  20. extern int oaktech;
  21. extern int vga512;
  22.  
  23. extern int maxx,maxy;
  24.  
  25. main(argc,argv)
  26. int argc;
  27. char **argv;
  28. {
  29.     unsigned char palbuf[256][3];
  30.     unsigned long x2;
  31.     int svga;
  32.     unsigned int color;
  33.     unsigned int x,y;
  34.  
  35.     for(x=0;x<256;x++)
  36.     {
  37.         y=x&63;
  38.         if(x&64) y=63-y;
  39.         palbuf[x][0]=y;
  40.         palbuf[x][1]=y*y/63;
  41.         y=(x>>1)&63;
  42.         if(x&128) y=63-y;
  43.         palbuf[x][2]=y;
  44.     }
  45.     svga=whichvga();    
  46.     if(svga)
  47.     {
  48.         svgamode();
  49.     }
  50.     else
  51.     {
  52.         mode13x();
  53.     }
  54.     setmany(palbuf,0,256);
  55.     for(x=0;x<maxx/2;x++)
  56.     {
  57.         for(y=0;y<maxy/2;y++)
  58.         {
  59.             x2=(x+1)*(maxx-x);
  60.             color=((x2*x2)/((y+1)*(long)(maxy-y))/113)&0xff;
  61.             if(svga)
  62.             {
  63.                 point(x,y,color);
  64.                 point((maxx-1)-x,y,color);
  65.                 point(x,(maxy-1)-y,color);
  66.                 point((maxx-1)-x,(maxy-1)-y,color);
  67.             }
  68.             else
  69.             {
  70.                 point13x(x,y,color);
  71.                 point13x((maxx-1)-x,y,color);
  72.                 point13x(x,(maxy-1)-y,color);
  73.                 point13x((maxx-1)-x,(maxy-1)-y,color);
  74.             }
  75.         }
  76.     }
  77.     getch();
  78.     txtmode();
  79. }
  80.  
  81.  
  82.  
  83.  
  84.